package com.kaili.basic.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.kaili.basic.mapper.MdmOrgMapper;
import com.kaili.basic.pojo.dto.MdmOrgQueryByPageDto;
import com.kaili.basic.pojo.dto.MdmOrgQueryDto;
import com.kaili.basic.pojo.entity.MdmOrgEntity;
import com.kaili.basic.pojo.vo.MdmOrgQueryAllVo;
import com.kaili.basic.service.MdmOrgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MdmOrgServiceImpl implements MdmOrgService {
    @Autowired
    private MdmOrgMapper mdmOrgMapper;

    @Override
    public Page<MdmOrgQueryAllVo> queryPageList(Page<MdmOrgQueryAllVo> page, MdmOrgQueryByPageDto mdmOrgQueryByPageDto) {
        List<MdmOrgQueryAllVo> mdmOrgQueryAllVoList = mdmOrgMapper.queryPageList(page,mdmOrgQueryByPageDto);
        return page.setRecords(mdmOrgQueryAllVoList);
    }

    @Override
    public void add(MdmOrgEntity mdmOrgEntity) {
        mdmOrgMapper.add(mdmOrgEntity);
    }

    @Override
    public void update(MdmOrgEntity mdmOrgEntity) {

        mdmOrgMapper.update(mdmOrgEntity);
    }

    @Override
    public void delete(int id) {
        mdmOrgMapper.delete(id);
    }

    @Override
    public String getCode() {
        return mdmOrgMapper.getCode();
    }

    @Override
    public List<MdmOrgQueryAllVo> queryOrgExport(MdmOrgQueryByPageDto mdmOrgQueryByPageDto) {
        return mdmOrgMapper.queryOrgExport(mdmOrgQueryByPageDto);
    }

    @Override
    public List<MdmOrgEntity> queryOrgRanges(MdmOrgQueryDto mdmOrgQueryDto) {
        return mdmOrgMapper.queryOrgRanges(mdmOrgQueryDto);
    }

    @Override
    public  MdmOrgEntity queryOrgById(int id) {

        return mdmOrgMapper.queryOrgById(id);
    }
}
